package cn.iocoder.yudao.module.crossborder.order.dal.mysql.orderpayment;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.crossborder.order.dal.dataobject.orderpayment.OrderPaymentDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.crossborder.order.controller.admin.orderpayment.vo.*;

/**
 * 跨境电商订单支付 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OrderPaymentMapper extends BaseMapperX<OrderPaymentDO> {

    default PageResult<OrderPaymentDO> selectPage(OrderPaymentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderPaymentDO>()
                .eqIfPresent(OrderPaymentDO::getOrderId, reqVO.getOrderId())
                .eqIfPresent(OrderPaymentDO::getOrderNo, reqVO.getOrderNo())
                .eqIfPresent(OrderPaymentDO::getPaymentNo, reqVO.getPaymentNo())
                .eqIfPresent(OrderPaymentDO::getPlatformPaymentId, reqVO.getPlatformPaymentId())
                .eqIfPresent(OrderPaymentDO::getPaymentMethod, reqVO.getPaymentMethod())
                .eqIfPresent(OrderPaymentDO::getPaymentChannel, reqVO.getPaymentChannel())
                .eqIfPresent(OrderPaymentDO::getPaymentProvider, reqVO.getPaymentProvider())
                .eqIfPresent(OrderPaymentDO::getPaymentType, reqVO.getPaymentType())
                .eqIfPresent(OrderPaymentDO::getPaymentAmount, reqVO.getPaymentAmount())
                .eqIfPresent(OrderPaymentDO::getCurrencyCode, reqVO.getCurrencyCode())
                .eqIfPresent(OrderPaymentDO::getExchangeRate, reqVO.getExchangeRate())
                .eqIfPresent(OrderPaymentDO::getBaseAmount, reqVO.getBaseAmount())
                .eqIfPresent(OrderPaymentDO::getFeeAmount, reqVO.getFeeAmount())
                .eqIfPresent(OrderPaymentDO::getGatewayFee, reqVO.getGatewayFee())
                .eqIfPresent(OrderPaymentDO::getProcessingFee, reqVO.getProcessingFee())
                .eqIfPresent(OrderPaymentDO::getNetAmount, reqVO.getNetAmount())
                .eqIfPresent(OrderPaymentDO::getPaymentStatus, reqVO.getPaymentStatus())
                .eqIfPresent(OrderPaymentDO::getTransactionId, reqVO.getTransactionId())
                .eqIfPresent(OrderPaymentDO::getAuthorizationCode, reqVO.getAuthorizationCode())
                .eqIfPresent(OrderPaymentDO::getReferenceNo, reqVO.getReferenceNo())
                .betweenIfPresent(OrderPaymentDO::getPaymentTime, reqVO.getPaymentTime())
                .betweenIfPresent(OrderPaymentDO::getExpireTime, reqVO.getExpireTime())
                .betweenIfPresent(OrderPaymentDO::getCallbackTime, reqVO.getCallbackTime())
                .eqIfPresent(OrderPaymentDO::getCallbackData, reqVO.getCallbackData())
                .eqIfPresent(OrderPaymentDO::getRiskScore, reqVO.getRiskScore())
                .eqIfPresent(OrderPaymentDO::getRiskLevel, reqVO.getRiskLevel())
                .eqIfPresent(OrderPaymentDO::getFraudCheckResult, reqVO.getFraudCheckResult())
                .eqIfPresent(OrderPaymentDO::getPaymentInfo, reqVO.getPaymentInfo())
                .eqIfPresent(OrderPaymentDO::getErrorCode, reqVO.getErrorCode())
                .eqIfPresent(OrderPaymentDO::getErrorMessage, reqVO.getErrorMessage())
                .eqIfPresent(OrderPaymentDO::getRetryCount, reqVO.getRetryCount())
                .eqIfPresent(OrderPaymentDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(OrderPaymentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OrderPaymentDO::getId));
    }

}